package java8;

public class ExtensionMethodsDemo {

    public static void main(String[] args) {
        IExtensionMethods extensionMethods = new IExtensionMethods() {};
        extensionMethods.defaultMethod();
        extensionMethods = new ExtensionMethodsImpl();
        extensionMethods.defaultMethod();

    }

    static class ExtensionMethodsImpl implements IExtensionMethods{

        @Override
        public void defaultMethod() {
            System.out.println("Override a default method");
        }
    }
}
